#ifndef __Ray_hpp__
#define __Ray_hpp__

#include "Vector3.hpp"

namespace ge {

//----------------------------------------------------------------------------//
// Ray
//----------------------------------------------------------------------------//

class Ray
{
 public:

     Ray( void ) : origin( Vector3::Zero ), dir( Vector3::UnitZ )
     {
     }

     Ray( const Vector3& _origin, const Vector3& _dir ) : origin( _origin ), dir( _dir )
     {
     }

     Vector3 Point( float _t ) const
     {
          return origin + ( dir * _t );
     }

     Vector3 operator * ( float _t ) const
     {
          return Point( _t );
     }

     friend Vector3 operator * ( float _t, const Ray& _ray )
     {
          return _ray.Point( _t );
     }

 public:

     Vector3 origin;
     Vector3 dir;
};

} // namespace ge

#endif//__Ray_hpp__
